<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>oauth2client.file.Storage</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="oauth2client-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="oauth2client-module.html">Package&nbsp;oauth2client</a> ::
        <a href="oauth2client.file-module.html">Module&nbsp;file</a> ::
        Class&nbsp;Storage
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="oauth2client.file.Storage-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Storage</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_oauth2cl_43" name="uml_class_diagram_for_oauth2cl_43">
<area shape="rect" id="node1_9" href="oauth2client.file.Storage-class.html#__init__" title="x.__init__(...) initializes x; see help(type(x)) for signature" alt="" coords="17,148,188,167"/>
<area shape="rect" id="node1_10" href="oauth2client.file.Storage-class.html#acquire_lock" title="Acquires any lock necessary to access this Storage." alt="" coords="17,167,188,185"/>
<area shape="rect" id="node1_11" href="oauth2client.file.Storage-class.html#release_lock" title="Release the Storage lock." alt="" coords="17,185,188,204"/>
<area shape="rect" id="node1_12" href="oauth2client.file.Storage-class.html#locked_get" title="Retrieve Credential from file." alt="" coords="17,204,188,223"/>
<area shape="rect" id="node1_13" href="oauth2client.file.Storage-class.html#locked_put" title="Write Credentials to file." alt="" coords="17,223,188,241"/>
<area shape="rect" id="node1_14" href="oauth2client.file.Storage-class.html#locked_delete" title="Delete Credentials file." alt="" coords="17,241,188,260"/>
<area shape="rect" id="node1" href="oauth2client.file.Storage-class.html" title="Store and retrieve a single credential to and from a file." alt="" coords="5,117,200,267"/>
<area shape="rect" id="node2_15" href="oauth2client.client.Storage-class.html#get" title="Retrieve credential." alt="" coords="40,36,165,55"/>
<area shape="rect" id="node2_16" href="oauth2client.client.Storage-class.html#put" title="Write a credential." alt="" coords="40,55,165,73"/>
<area shape="rect" id="node2_17" href="oauth2client.client.Storage-class.html#delete" title="Delete credential." alt="" coords="40,73,165,92"/>
<area shape="rect" id="node2" href="oauth2client.client.Storage-class.html" title="Base class for all Storage objects." alt="" coords="28,5,177,99"/>
</map>
  <img src="uml_class_diagram_for_oauth2cl_43.gif" alt='' usemap="#uml_class_diagram_for_oauth2cl_43" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<pre class="literalblock">
Store and retrieve a single credential to and from a file.

</pre>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">filename</span>)</span><br />
      x.__init__(...) initializes x; see help(type(x)) for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_validate_file"></a><span class="summary-sig-name">_validate_file</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage._validate_file">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#acquire_lock" class="summary-sig-name">acquire_lock</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Acquires any lock necessary to access this Storage.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.acquire_lock">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#release_lock" class="summary-sig-name">release_lock</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Release the Storage lock.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.release_lock">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#locked_get" class="summary-sig-name">locked_get</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Retrieve Credential from file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.locked_get">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#_create_file_if_needed" class="summary-sig-name" onclick="show_private();">_create_file_if_needed</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Create an empty file if necessary.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage._create_file_if_needed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#locked_put" class="summary-sig-name">locked_put</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">credentials</span>)</span><br />
      Write Credentials to file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.locked_put">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.file.Storage-class.html#locked_delete" class="summary-sig-name">locked_delete</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Delete Credentials file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.locked_delete">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Storage-class.html">client.Storage</a></code></b>:
      <code><a href="oauth2client.client.Storage-class.html#delete">delete</a></code>,
      <code><a href="oauth2client.client.Storage-class.html#get">get</a></code>,
      <code><a href="oauth2client.client.Storage-class.html#put">put</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">filename</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
x.__init__(...) initializes x; see help(type(x)) for signature

</pre>
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="acquire_lock"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acquire_lock</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.acquire_lock">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Acquires any lock necessary to access this Storage.

This lock is not reentrant.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#acquire_lock">client.Storage.acquire_lock</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="release_lock"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">release_lock</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.release_lock">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Release the Storage lock.

Trying to release a lock that isn't held will result in a
RuntimeError.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#release_lock">client.Storage.release_lock</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="locked_get"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">locked_get</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.locked_get">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Retrieve Credential from file.

Returns:
  oauth2client.client.Credentials

Raises:
  CredentialsFileSymbolicLinkError if the file is a symbolic link.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#locked_get">client.Storage.locked_get</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="_create_file_if_needed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_create_file_if_needed</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage._create_file_if_needed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Create an empty file if necessary.

This method will not initialize the file. Instead it implements a
simple version of &quot;touch&quot; to ensure the file has been created.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="locked_put"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">locked_put</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">credentials</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.locked_put">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Write Credentials to file.

Args:
  credentials: Credentials, the credentials to store.

Raises:
  CredentialsFileSymbolicLinkError if the file is a symbolic link.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#locked_put">client.Storage.locked_put</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="locked_delete"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">locked_delete</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.file-pysrc.html#Storage.locked_delete">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Delete Credentials file.

Args:
  credentials: Credentials, the credentials to store.

</pre>
  <dl class="fields">
    <dt>Overrides:
        <a href="oauth2client.client.Storage-class.html#locked_delete">client.Storage.locked_delete</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="oauth2client-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Sep 29 15:21:53 2014
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
